py_need = '''
# -------------------------------------------------------------------------------

# 比赛环境为python3.8.6版本自带的IDLE，最好早点熟悉一下。。这个东西的提示时有时无

# 菜单栏最右边的Help的Python Docs 比赛时候也可以看，不过建议还是提前多了解了解，

# 比赛的时候至少知道在文档找什么能用的上。
'''
java_need = '''
public class '''
java_need_tail = ''' {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
'''
import os
for i in os.listdir():
    if os.path.isdir(i):
        for j in os.listdir(i):
            if j.endswith(".py") or j.endswith(".py"):
                with open(f"{i}/{j}", "r", -1, "utf-8") as f:
                    try:
                        s = f.read()
                    except:
                        ff = open(f"{i}/{j}", "r")
                        s = ff.read()
                        ff.close()
                    name = j.split(".")[0]
                    if s == "":
                    # if not os.path.isfile(f"{i}/{name}.py"):
                        with open(f"{i}/{name}.py", "w") as f1:
                            f1.write(s + py_need)
                    if not os.path.isfile(f"{i}/{name}.java"):
                        with open(f"{i}/{name}.java", "w") as f1:
                            f1.write(s + java_need + name + java_need_tail)
